473,421 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

Applying CSS Styles to Dropdownlist

Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil
May 15 '06 #1
4 10213
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #2
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil



May 15 '06 #3
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #4
Believe me, I only posted this message once.

;-)

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Or**************@TK2MSFTNGP02.phx.gbl...
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jaz | last post by:
Is there a reason why IE wont apply styles on table cells? Either I shouldn't do this, I've got an error somewhere, or IE has a bug or doesn't support it. (Opera and Moz render okay) Since I've...
1
by: Steve Pugh | last post by:
I have some styles which IE (Win - tested in 5, 5.5 and 6) is only applying to the first letter of the element. Basic stuff like font-weight and font-size applied to a <p> or <hx> element via...
3
by: Armand Karlsen | last post by:
Is it possible to apply the same styling code as is used on my web page to a CGI-based hit-counter, where the script is a pre-made one supplied by the ISP? The webpage in question is:...
3
by: Gandalf | last post by:
I wish to apply different styles to items in a DropDownList. However, any styles applied in the codebehind (using the ListItem.Addtributes property) do not get rendered. This is an old question but...
7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
2
by: luke.crouch | last post by:
My server-side php script is generating an xml response with the following structure: <thread class='Columns'> <Id class='Column dataDetail'>12345</Id> <Command class='Column...
2
by: viveklinux | last post by:
Hi, Have a FAQ page , where have many sets of questions and answers. The questions need to be a different colour / style and the answers different. Was wondering is there a easy way to do this...
5
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A...
8
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.